Error Boundary
Reactで例外処理的なことをする仕組み
子コンポーネントでのエラーを親でcatchする
https://reactjs.org/docs/error-boundaries.html
static getDerivedStateFromError()かcomponentDidCatch()を使う(もしくは両方)
この二つはまだHooksでは使えないので、classコンポーネントにすることになる
https://reactjs.org/docs/hooks-faq.html#how-do-lifecycle-methods-correspond-to-hooks